//
//  QueryStaffCell.swift
//  Slaughter
//
//  Created by Ken on 2018/7/26.
//  Copyright © 2018年 zwb. All rights reserved.
//

import UIKit

class KSSingleSelectCell: KSBaseTableViewCell {
    
    var left1 :UILabel = UILabel()
    var right1 :UILabel = UILabel()
    var left2 :UILabel = UILabel()
    var right2 :UILabel = UILabel()
    var left3 :UILabel = UILabel()
    var right3 :UILabel = UILabel()
    var left4 :UILabel = UILabel()
    var right4 :UILabel = UILabel()
    var left5 :UILabel = UILabel()
    var right5 :UILabel = UILabel()
    
    lazy var leftBottomImg:UIImageView = {
         let v = UIImageView()
     return v
     }()
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
       bg.addSubview(left1)
        left1.font = UIFont.systemFont(ofSize: 16)
        left1.snp.makeConstraints { (make) in
            make.left.equalTo(bg).offset(15)
            make.top.equalTo(bg).offset(8)
        }
         
        bg.addSubview(right1)
        right1.font = UIFont.systemFont(ofSize: 16)
        right1.textAlignment = .right
        right1.snp.makeConstraints { (make) in
            make.right.equalTo(bg).offset(-15)
            make.centerY.equalTo(left1)
        }
        bg.addSubview(left2)
        left2.font = UIFont.systemFont(ofSize: 16)
        left2.snp.makeConstraints { (make) in
            make.left.equalTo(left1)
            make.top.equalTo(left1.snp.bottom).offset(4)
        }
        self.contentView.addSubview(right2)
        right2.font = UIFont.systemFont(ofSize: 16)
        right2.textAlignment = .right
        right2.snp.makeConstraints { (make) in
            make.right.equalTo(right1)
            make.centerY.equalTo(left2)
        }
        bg.addSubview(left3)
        left3.font = UIFont.systemFont(ofSize: 16)
        left3.snp.makeConstraints { (make) in
            make.left.equalTo(left1)
            make.top.equalTo(left2.snp.bottom).offset(4)
        }
        bg.addSubview(right3)
        right3.font = UIFont.systemFont(ofSize: 16)
        right3.textAlignment = .right
        right3.snp.makeConstraints { (make) in
            make.right.equalTo(right1)
            make.centerY.equalTo(left3)
        }
        bg.addSubview(left4)
        left4.font = UIFont.systemFont(ofSize: 16)
        left4.snp.makeConstraints { (make) in
            make.left.equalTo(left1)
            make.top.equalTo(left3.snp.bottom).offset(4)
        }
        bg.addSubview(right4)
        right4.font = UIFont.systemFont(ofSize: 16)
        right4.textAlignment = .right
        right4.snp.makeConstraints { (make) in
            make.right.equalTo(right1)
            make.centerY.equalTo(left4)
        }
        bg.addSubview(left5)
        left5.font = UIFont.systemFont(ofSize: 16)
        left5.snp.makeConstraints { (make) in
            make.left.equalTo(left1)
            make.top.equalTo(left4.snp.bottom).offset(4)
        }
        bg.addSubview(right5)
        right5.font = UIFont.systemFont(ofSize: 16)
        right5.textAlignment = .right
        right5.snp.makeConstraints { (make) in
            make.right.equalTo(right1)
            make.centerY.equalTo(left5)
        }
         bg.addSubview(leftBottomImg)
        leftBottomImg.snp.makeConstraints { (make) in
             make.left.equalTo(bg).offset(10)
            make.height.equalTo(22)
            make.width.equalTo(20)
              make.bottom.equalTo(bg).offset(-3)
         }
     }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        
        // Configure the view for the selected state
    }
    
}



class KSBaseTableViewCell: UITableViewCell {

    lazy var bg:UIView = {
       let v = UIView()
        v.backgroundColor = .white
        v.layer.cornerRadius = 8
        v.layer.masksToBounds = true
        return v
    }()
    
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.contentView.backgroundColor = Theme.awModuleBgColor
          self.contentView.addSubview(bg)
        bg.snp.makeConstraints { make in
            make.left.equalTo(self.contentView).offset(6)
            make.top.equalTo(self.contentView).offset(6)
            make.right.equalTo(self.contentView).offset(-6)
            make.bottom.equalTo(self.contentView)
         }
        
      
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
